package com.gzhryc.event.dao.enums;

public class TimeTaskEnum {

	public enum Status {
		
		Unusable(1,"未启用"),Usable(2,"已启用"),Loading(3,"已加载"),End(4,"已完成");
		
		private Integer index;
		private String note;
		
		Status(Integer index,String note){
			this.index = index;
			this.note = note;
		}

		public Integer index() {
			return index;
		}

		public String note() {
			return note;
		}
		
		public static String note(Integer index){
			Status[] temp = Status.values();
			for(int i=0;i<temp.length;i++){
				Status item = temp[i];
				if(item.index.equals(index)){
					return item.note;
				}
			}
			return null;
		}
	}
	
	public enum RunType {
		
		Once(1,"执行一次"),Cron(2,"Cron表达式"),ManyTimes(3,"执行多次");
		
		private Integer index;
		private String note;
		
		RunType(Integer index,String note){
			this.index = index;
			this.note = note;
		}

		public Integer index() {
			return index;
		}

		public String note() {
			return note;
		}
		
		public static String note(Integer index){
			RunType[] temp = RunType.values();
			for(int i=0;i<temp.length;i++){
				RunType item = temp[i];
				if(item.index.equals(index)){
					return item.note;
				}
			}
			return null;
		}
	}
}
